Ext.define('MyApp.view.FeedPost', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.feedpost',

    cls: 'preview',
    autoScroll: true,

    initComponent: function() {
        var me = this;

        me.callParent(arguments);
    },

    createToolbar: function() {
        var items = [],
            config = {};

        if (!this.inTab) {
            items.push({
                itemId: 'viewintab',
                text: 'View in new tab',
                iconCls: 'tab-new'
            }, '-');
        } else {
            config.cls = 'x-docked-noborder-top';
        }

        items.push({
            itemId: 'gotopost',
            text: 'Go to post',
            iconCls: 'post-go'
        });

        config.items = items;

        return Ext.create('widget.toolbar', config);
    }

});